# 继承+重写
class WhoSay:
    def say(self, who):
        who.say()


class CLanguage:
    def say(self):
        print("调用的是 Clanguage 类的say方法")


class CPython(CLanguage):
    def say(self):
        print("调用的是 CPython 类的say方法")


class CLinux(CLanguage):
    def say(self):
        print("调用的是 CLinux 类的say方法")


# 多态
a = CLanguage()
a.say()
a = CPython()
a.say()
a = CLinux()
a.say()

a = WhoSay()
a.say(CLanguage())
a.say(CPython())
a.say(CLinux())
